#pragma once
#include "shape.h"
#include <vector>
using namespace std;

class MCube :public Shape
{
private:
	float ox, oy, oz;	//center of cube
	float l;
	int seg;
	MVertex **verts;
	MVertex *points;
	MVertex *normal;
	int step;
private:
	MCube(float al, float ars, float aox=0, float aoy=0, float aoz=0);
public:
	static MCube *makeCube(float al, float ars, float aox=0, float aoy=0, float aoz=0);
	void updateCube(float al, float ars, float aox=0, float aoy=0, float aoz=0);
	void drawCube(void(*func)(const MVertex &p1,  const MVertex &p2, const MVertex &p3, int ic),
								void(*drawline)(const MVertex &p1,  const MVertex &p2,int ic)=NULL);
	void drawCube(void(*draw_poly)(const vector<MVertex> &v1, int ic),
								void(*drawline)(const MVertex &p1,  const MVertex &p2,int ic)=NULL);
	~MCube(void);
	void drawShape();
	void incrementSlice();
	void decrementSlice();
	void incrementStack();
	void decrementStack();
	void translate(float x, float y, float z);
	void rotate(float deg, int x, int y, int z);
	void rotateAroundOwnAxis(float theta);
	void scale(float x, float y, float z);
};

